package kd.comt.plugin;

import kd.bos.form.plugin.AbstractFormPlugin;
import kd.bos.form.events.BeforeDoOperationEventArgs;
import kd.bos.form.operate.FormOperate;
import kd.bos.form.control.RichTextEditor;
import java.util.EventObject;

public class djdt extends AbstractFormPlugin{
    @Override
	public void beforeDoOperation(BeforeDoOperationEventArgs args){
		super.beforeDoOperation(args);
		FormOperate operate=(FormOperate)args.getSource();
		String key = operate.getOperateKey();
		if(key.equals("save")) {
			RichTextEditor edit =this.getView().getControl("bpgx_djfwb1");//获取富文本1控件内容
			this.getModel().setValue("bpgx_djdtdwb_tag", edit.getText());
        }

	}
	@Override
	public void afterBindData(EventObject e) {
		// TODO Auto-generated method stub
		super.afterBindData(e);

		RichTextEditor edit = this.getView().getControl("bpgx_djfwb2"); //获取富文本2控件内容
		edit.setText((String)this.getModel().getValue("bpgx_djdtdwb_tag"));//将大文本存储的内容给富文本2

        RichTextEditor edit2 = this.getView().getControl("bpgx_djfwb1");//获取富文本1控件内容
		edit2.setText((String)this.getModel().getValue("bpgx_djdtdwb_tag"));//将大文本存储的内容给富文本1
	}


}





